package main.java.flyweight;


import java.util.HashMap;

public class BoxFactory {
    private static BoxFactory factory = new BoxFactory();
    private HashMap<String, AbstartBox> map;

    private BoxFactory() {
        map = new HashMap<>();
        map.put("I", new IBox());
        map.put("L", new LBox());
        map.put("O", new OBox());
    }


    /**
     *
     */

    public AbstartBox getShape(String name) {
        return map.get(name);
    }

    public static BoxFactory getInstance() {
        return factory;
    }
}


